<template>
<div>
      <div>借款需求</div>
<div>
  
<el-row>
  <el-col :span="4"><div class="grid-content bg-purple">放款人信息</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.lenderinformation"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">开户机构</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.accountinginstitute"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">付款账户</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.paymentaccount"></el-input></div></el-col>
</el-row>
<el-row>
   <el-col :span="4"><div class="grid-content bg-purple">合同编号</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.contractnumber"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">签署日期</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.datesigning"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">客户名称</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.customername"></el-input></div></el-col>
</el-row>
<el-row>
  <el-col :span="4"><div class="grid-content bg-purple">签署地址</div></el-col>
  <el-col :span="20"><div class="grid-content bg-purple-light"><el-input v-model="infoData.signingaddress"></el-input></div></el-col>
</el-row>
<el-row>
  <el-col :span="4"><div class="grid-content bg-purple">借款金额</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.loanamount"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">产品名称</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.productname"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">还款方式</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.repaymentmethod"></el-input></div></el-col>
</el-row>
<el-row>
  <el-col :span="4"><div class="grid-content bg-purple">期限类型</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.termtype"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">期限</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.term"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">月利率（%）</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.monthlyrate"></el-input></div></el-col>
</el-row>
<el-row>
  <el-col :span="4"><div class="grid-content bg-purple">手续费率（%）</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.processingfees"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">违约利率（%）</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.defaultrate"></el-input></div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple">借款主体</div></el-col>
  <el-col :span="4"><div class="grid-content bg-purple-light"><el-input v-model="infoData.borrower"></el-input></div></el-col>
</el-row>
<el-row>
  <el-col :span="4"><div class="grid-content bg-purple">借款用途</div></el-col>
  <el-col :span="20"><div class="grid-content bg-purple-light"><el-input v-model="infoData.usageloan"></el-input></div></el-col>
</el-row>
</div>
 <div>银行账户信息</div>
 
<div>
 <el-table :data="tableData" style="width: 100%" border height="150">
          <el-table-column type="index" label="序号" width="80">
          </el-table-column>
          <!-- <input type="hidden" value="bwid" prop="bwid" /> -->
          <el-table-column prop="bcdeposit" label="开户机构" width="180">
          </el-table-column>
          <el-table-column prop="bcnumber" label="收款账户账户" width="220"> </el-table-column>
          
             <el-table-column prop="bcBelonging" label="所属支行" width="360"> </el-table-column>
              
               <el-table-column
      fixed="right"
      label="操作"
      width="180">
      <template slot-scope="scope">
       <el-button
          @click.native.prevent="deleteRow(scope.$index, tableData)"
          type="text"
          size="small">
          移除
        </el-button>
      </template>
    </el-table-column>
        </el-table>
</div>
 
<div style="margin-top:25px">
    <el-row >
  <el-col :span="2" :offset="20">  <el-button size="medium" type="success" plain @click="goBack()">返回</el-button></el-col>
</el-row>
   
</div>
</div>
 
</template>

<script>

export default ({
  data(){
    return {
     infoData:[],
     tableData:[],
     contractData:[],
    }
  },
  created:function() {
    var bwid = this.$route.query.bwid;
        this.getInfoByBoid();
        this. getBankByBoid();
       
},
   methods:{
        deleteRow(index, rows) {
        rows.splice(index, 1);
      },
       // 查找银行
       getBankByBoid(){
           this.$axios.post("http://localhost:8082/loan/getBankByBoid",{
              
                  boid: this.$route.query.bwid
           
           }).then(resp=>{
               console.log(resp.data);
               this.tableData=resp.data.data
           });
       },
  
        goBack() {
        this.$router.push("/home")
        },
      getInfoByBoid() {
          console.log("bwid:"+this.$route.query.bwid)
             this.$axios.post("http://localhost:8082/loan/getInfoByBoid", {
               
                     boid: this.$route.query.bwid,
            }).then(resp=>{
                console.log(resp.data);
                
                
                var msg = resp.data.message
                if(resp.data.code==500){
                    this.$message({
          showClose: true,
          message:msg,
          type: 'warning',
          duration:1500
        });
                }else{
                    this.infoData=resp.data.data
                }
            });
      },
  },
  
})
</script>

<style>

      .el-row {
    margin-bottom: 20px;
  
  }
  .el-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: #99a9bf;
  }
  .bg-purple {
    background: #d3dce6;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
</style>
